<script setup lang="ts">
import { ref } from 'vue';
import AuthBar from '@/components/authBar/index.vue';

const searchValue = ref('');

function handleSearch() {}

const searchTypeList = ref([
  {
    title: '科室信息',
    icon: 'icon-a-rongqi5',
    desc: '查询医院科室设置及介绍',
    path: '/pages/informationQuery/department'
  },
  {
    title: '医生信息',
    icon: 'icon-a-rongqi1',
    desc: '查询医生出诊时间及专长',
    path: '/pages/informationQuery/doctor'
  },
  {
    title: '就诊流程',
    icon: 'icon-a-rongqi6',
    desc: '查询就诊流程指示',
    path: '/pages/informationQuery/process'
  },
  {
    title: '价格公示',
    icon: 'icon-a-rongqi7',
    desc: '公示医院药品、检验和检查的价格',
    path: '/pages/informationQuery/price'
  },
  {
    title: '院区地图',
    icon: 'icon-a-rongqi8',
    desc: '整个院区平面地图信息',
    path: '/pages/informationQuery/map'
  }
]);

function handleClick(item) {
  uni.navigateTo({
    url: item.path
  });
}
</script>

<template>
  <view class="page flex-col">
    <AuthBar back-home />
    <view class="flex-1 overflow-auto pb-40">
      <view class="search flex-center items-start">
        <view class="w-750 flex">
          <view class="relative mr-36 flex-1 self-start">
            <wd-input v-model="searchValue" placeholder="请输入汉字/拼音首字母进行项目模糊搜索" />
            <view class="search-btn">
              <wd-button @click="handleSearch">
                搜索
              </wd-button>
            </view>
          </view>
        </view>
      </view>
      <view class="page-content mx-48">
        <view class="page-title">
          选择查询类型
        </view>
        <view class="page-subtitle">
          请选择您需要查询的类型
        </view>
        <view class="search-group">
          <view
            v-for="item in searchTypeList"
            :key="item.title"
            class="search-item"
            @click="handleClick(item)"
          >
            <view class="search-item__cover">
              <i class="iconfont" :class="[item.icon]" />
            </view>
            <view class="search-item__content">
              <view class="search-item__title">
                {{ item.title }}
              </view>
              <view class="search-item__desc">
                {{ item.desc }}
              </view>
            </view>
          </view>
        </view>
      </view>
    </view>
  </view>
</template>

<route type="page" lang="json5">
{
  layout: 'default',
  style: {
    navigationBarTitleText: '信息查询',
    navigationStyle: 'custom'
  }
}
</route>

<style lang="scss" scoped>
.page {
  height: 100%;
  background: var(--bg-color);

  .search {
    padding: 38px 48px;
    --wot-input-inner-height: 68px;
    --wot-input-fs: 20px;
    --wot-input-placeholder-color: #767676;
    :deep(.wd-input) {
      border-radius: 8px;
      background: #eff5ff;
      border: 1px solid #ffffff;
      box-sizing: border-box;
      padding-left: 20px;

      &:after {
        background: transparent;
      }
    }

    .search-btn {
      position: absolute;
      top: 0;
      bottom: 0;
      right: 0;
      :deep(.wd-button) {
        width: 98px;
        height: 100%;
        background: var(--primary);
        color: #fff;
        border-radius: 0px 6px 6px 0px;
        font-size: 26px;
      }
    }

    .select-arrow {
      position: absolute;
      right: 24px;
      top: 50%;
      transform: translateY(-50%);
    }
  }

  .page-content {
    border: 2px solid #e6effd;
    background: #d8e7ff;
    border-radius: 20px;
    padding: 40px 52px;
  }

  .page-title {
    font-size: 48px;
    font-weight: bold;
    color: var(--text-color);
  }

  .page-subtitle {
    font-size: 30px;
    color: var(--secondary-text-color);
  }

  .search-group {
    margin-top: 36px;

    .search-item {
      @apply flex items-center;
      background: #f5f9ff;
      padding: 43px 30px;
      border-radius: 20px;
      margin-bottom: 20px;

      .search-item__cover {
        @apply flex-center;
        background: #e1ecff;
        border-radius: 20px;
        width: 114px;
        height: 124px;

        .iconfont {
          color: var(--primary);
          font-size: 74px;
        }
      }

      .search-item__content {
        margin-left: 34px;

        .search-item__title {
          font-size: 48px;
          font-weight: bold;
          color: var(--text-color);
        }

        .search-item__desc {
          font-size: 30px;
          color: #686869;
          margin-top: 14px;
        }
      }

      &:hover,
      &:active {
        background-color: var(--primary);

        .search-item__title,
        .search-item__desc,
        .search-item__detail {
          color: #fff;
        }
      }
    }
  }
}
</style>
